package com.example.auth.uitls;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

/**
 * @Classname Base64Util
 * @Description TODO
 * @Date 2022/5/29 14:32
 * @Created by XiongXiong
 * @Author: X.I.O
 */
public class Base64Util {

    /***
     * BASE64解密
     * @param key
     * @return
     * @throws Exception
     */
    public static byte[] decryBASE64(String key) throws Exception{
      return (new BASE64Decoder()).decodeBuffer(key);
    }

    /***
     * BASE64加密
     * @param key
     * @return
     * @throws Exception
     */
    public static String encryptBASE64(byte[] key) throws Exception{
      return (new BASE64Encoder()).encode(key);
    }

}
